package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.WxOrderList;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WxOrderListMapper {

    @Select("SELECT * FROM wx_order_list WHERE user_id = #{userId} AND goods_list_id = #{goodsListId} AND status = #{status} AND insurance = #{insurance}")
    List<WxOrderList> selectList(@Param("userId") String userId,@Param("goodsListId") String goodsListId, @Param("status") int status,@Param("insurance") int insurance);

    @Update("UPDATE wx_order_list SET status = #{wxs.status} WHERE id = #{wxs.id}")
    Integer updateById(@Param("wxs") WxOrderList orderList);

    List<WxOrderList> selectListByGoodsListId(@Param("userId") String userId, @Param("insurance") Integer insurance, @Param("status") int i);

    @Delete("DELETE FROM wx_order_list WHERE id = #{id}")
    Integer deleteByOrderId(@Param("id") Integer id);
}
